<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDataUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('data', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('card_id')->nullable();
            $table->string('user_id')->nullable();
            $table->string('realname')->nullable();
            $table->string('pinyin')->nullable();
            $table->string('avatar')->nullable();
            $table->integer('avatar_id')->default(0);
            $table->string('sex')->nullable();
            $table->string('phone')->nullable();
            $table->string('email')->nullable();
            $table->string('title')->nullable();
            $table->string('company')->nullable();
            $table->string('position')->nullable();
            $table->string('certified')->nullable();
            $table->string('status')->nullable();
            $table->string('views')->nullable();
            $table->string('birthday')->nullable();
            $table->string('address')->nullable();
            $table->string('intro')->nullable();
            $table->string('citycode')->nullable();
            $table->string('cityname')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::create('data_card_educations', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer("data_id")->default(0);
            $table->string('university')->nullable();
            $table->string('major')->nullable();
            $table->string('education')->nullable();
            $table->string('from_date')->nullable();
            $table->string('to_date')->nullable();
            $table->string('description')->nullable();
            $table->string('card_id')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::create('data_card_works', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer("data_id")->default(0);
            $table->string('company')->nullable();
            $table->string('position')->nullable();
            $table->string('from_date')->nullable();
            $table->string('to_date')->nullable();
            $table->string('description')->nullable();
            $table->string('card_id')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::create('data_card_extends', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer("data_id")->default(0);
            $table->string('key')->nullable();
            $table->string('value')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
